﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Assembly="Winnow.SharepointDesigner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=53328ac4f6868226"
    Namespace="Winnow.SharepointDesigner.Controls" TagPrefix="cc1" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SharepointExplorer.aspx.cs"
    Inherits="Winnow.SharepointDesigner.Layouts.Winnow.SharepointDesigner.SharepointExplorer"
    DynamicMasterPageFile="~masterurl/minimal.master" %>

<style type="text/css">
    html, body
    {
        width: 100%;
        height: 100%;
        margin: 0;
        overflow: hidden;
    }
    
    #borderContainerTwo
    {
        width: 100%;
        height: 100%;
    }
    
    img
    {
        border: 0px;
    }
</style>
<style>
    .mGrid
    {
        width: 100%;
        background-color: #fff;
        margin: 5px 0 10px 0;
        border: solid 1px #525252;
        border-collapse: collapse;
    }
    .mGrid td
    {
        padding: 2px;
        border: solid 1px #c1c1c1;
        color: #717171;
    }
    .mGrid th
    {
        padding: 4px 2px;
        color: #fff;
        background: #424242 url(/_layouts/images/ClaySys.CompanySystem/grd_head.png) repeat-x top;
        border-left: solid 1px #525252;
        font-size: 0.9em;
    }
    .mGrid .alt
    {
        background: #fcfcfc url(/_layouts/images/ClaySys.CompanySystem/grd_alt.png) repeat-x top;
    }
    .mGrid .pgr
    {
        background: #424242 url(/_layouts/images/ClaySys.CompanySystem/grd_pgr.png) repeat-x top;
    }
    .mGrid .pgr table
    {
        margin: 5px 0;
    }
    .mGrid .pgr td
    {
        border-width: 0;
        padding: 0 6px;
        border-left: solid 1px #666;
        font-weight: bold;
        color: #fff;
        line-height: 12px;
    }
    .mGrid .pgr a
    {
        color: #666;
        text-decoration: none;
    }
    .mGrid .pgr a:hover
    {
        color: #000;
        text-decoration: none;
    }
</style>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit/themes/claro/claro.css"
    media="screen">
<!-- load dojo and provide config via data attribute -->
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" data-dojo-config="parseOnLoad: true"></script>
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"> </script>
<script>
    dojo.require("dijit.layout.ContentPane");
    dojo.require("dijit.layout.BorderContainer");
    dojo.require("dijit.layout.TabContainer");
    dojo.require("dijit.layout.AccordionContainer");

    dojo.require("dijit.MenuBar");
    dojo.require("dijit.PopupMenuBarItem");
    dojo.require("dijit.DropDownMenu");
    dojo.require("dijit.MenuItem");

    var loginName = "<%= Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.Name %>";</script>
</script>
<script type="text/javascript"></script>
<script language="javascript">


    function addWebTab(webId, title) {

        var tc = dijit.byId("tabContainer");
        var cp1 = new dijit.layout.ContentPane({
            title: "<img style='margin:1px' height='12px' src='/_layouts/images/SharePointFoundation16.png'>" + title + "</img>",
            closable: true,
            selected: true,
            content: "<iframe frameborder=\"0\" style=\"height:100%;width:100%;\" src=\"/_layouts/Winnow.SharepointDesigner/Site.aspx?WebId=" + webId + "\"></iframe>"
        });
        tc.addChild(cp1);
        tc.selectChild(cp1);
    }
    function addListTab(webId, listId, title, imageUrl) {
        var tc = dijit.byId("tabContainer");
        var cp1 = new dijit.layout.ContentPane({
            title: "<img  style='margin:1px' height='12px' src='" + imageUrl + "'>" + title + "</img>",
            closable: true,
            selected: true,
            content: "<iframe frameborder=\"0\" style=\"height:100%;width:100%;\" src=\"/_layouts/Winnow.SharepointDesigner/List.aspx?WebId=" + webId + "&ListId=" + listId + "\"></iframe>"
        });
        tc.addChild(cp1);
        tc.selectChild(cp1);
    }
    function addLogTab(fileName) {
        var tc = dijit.byId("tabContainer");
        var cp1 = new dijit.layout.ContentPane({
            title: "<img  style='margin:1px' height='12px' src='/_layouts/images/SharePointFoundation16.png'>" + fileName + "</img>",
            closable: true,
            selected: true,
            content: "<iframe frameborder=\"0\" style=\"height:100%;width:100%;\" src=\"/_layouts/Winnow.SharepointDesigner/LogViewer.aspx?FileName=" + fileName + "\"></iframe>"
        });
        tc.addChild(cp1);
        tc.selectChild(cp1);
    }
    function addFeaturesTab() {
        var tc = dijit.byId("tabContainer");
        var cp1 = new dijit.layout.ContentPane({
            title: "<img  style='margin:1px' height='12px' src='/_layouts/images/SharePointFoundation16.png'>Features</img>",
            closable: true,
            selected: true,
            content: "<iframe frameborder=\"0\" style=\"height:100%;width:100%;\" src=\"/_layouts/Winnow.SharepointDesigner/Features.aspx\"></iframe>"
        });
        tc.addChild(cp1);
        tc.selectChild(cp1);
    }
    $(function () {
        var treeView1 = $('#<%= treSites.ClientID %>');
        var treeNodes = treeView1.find('div[id$=Nodes]');
        var treeImages = treeView1.find('img').not('img[alt=\'\']');

        $('#aToggleNodes').click(function () {
            if (this.innerHTML == 'Expand All') {
                treeNodes.css({ 'display': 'block' });
                treeImages.attr('src', '/_layouts/images/Claysys/minus.gif')
                this.innerHTML = 'Collapse All';
            }
            else {
                treeNodes.css({ 'display': 'none' });
                treeImages.attr('src', '/_layouts/images/Claysys/plus.gif')
                this.innerHTML = 'Expand All';
            }
            return false;
        });

    });

</script>
<form id="form1" runat="server" class="claro">
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="gutters:true, liveSplitters:false"
    id="borderContainerTwo">
    <div data-dojo-type="dijit.MenuBar" id="navMenu" data-dojo-props="region:'top', splitter:false">
        <div style="text-align: right">
            <script type="text/javascript">                document.write(loginName);</script>
        </div>
    </div>
    <div data-dojo-type="dijit.layout.AccordionContainer" data-dojo-props="minSize:20, region:'leading', splitter:true"
        style="width: 300px;" id="leftAccordion">
        <div data-dojo-type="dijit.layout.AccordionPane" title="Sites and List">
            <a href="#" id="aToggleNodes">Collapse All</a>
            <asp:treeview id="treSites" runat="server">
            
            </asp:treeview>
        </div>
        <div data-dojo-type="dijit.layout.AccordionPane" title="Log Viewer">
            <asp:gridview runat="server" id="grdLog" cssclass="mGrid" pagerstyle-cssclass="pgr"
                alternatingrowstyle-cssclass="alt" gridlines="None">
                     <Columns>
                        <asp:TemplateField HeaderText="File Name">
                            <ItemTemplate>
                            <a href="javascript:addLogTab('<%# DataBinder.Eval(Container.DataItem,"Value") %>')">
                                <asp:Label  runat="server"  Text='<%# DataBinder.Eval(Container.DataItem,"Value") %>' /> 
                            </a>
                            </ItemTemplate>
                         </asp:TemplateField>
                      </Columns>
             </asp:gridview>
        </div>
        <div data-dojo-type="dijit.layout.AccordionPane" title="Utility">
            <a href="javascript:addFeaturesTab()">Features</a>
        </div>
    </div>
    <!-- end AccordionContainer -->
    <div data-dojo-type="dijit.layout.TabContainer" id="tabContainer" data-dojo-props="region:'center', tabStrip:true">
        <div data-dojo-type="dijit.layout.ContentPane" title="<img style='margin:1px' height='12px' src='/_layouts/images/SharePointFoundation16.png'>Home</img>"
            selected="true">
            <img width="600px" src="/_layouts/images/Winnow.SharepointDesigner/logo_sharepoint_2010.jpg" />
            <cc1:DisplayLayout runat="server" Title="Roo Site Information" Description="Root Site Information.">
           <table>
           <tr>
           <td>
          
            Title</td>
           <td>  <asp:Image id="imgLogo" runat="server"></asp:Image><asp:label runat="server" id="lblTitle" text="Label"></asp:label> </td>
           </tr>
            <tr>
           <td>Description</td>
           <td> <asp:label runat="server" id="lblDescription" text="Label"></asp:label></td>
           </tr>
            <tr>
           <td>Web Address</td>
           <td><asp:hyperlink runat="server" id="hlnkHomeUrl" target="_blank"></asp:hyperlink></td>
           </tr>
               <tr>
                    <td>Sharepoint Version</td>
                    <td></td>
                </tr>
                 <tr>
                    <td>Server Version</td>
                    <td></td>
                </tr>
                 <tr>
                    <td>Total Storage Used</td>
                    <td></td>
                </tr>
                 <tr>
                    <td>% of Available Storage Used</td>
                    <td></td>
                </tr>
                 <tr>
                    <td>Owner</td>
                    <td><asp:label runat="server" id="lblOwner" text="Label"></asp:label></td>
                </tr>
               
           </table>
            
           
          
            </cc1:DisplayLayout>
        </div>
    </div>
    <!-- end TabContainer -->
</div>
</form>
